ANCEL
                                                                                    Pg 19-2

CANCEL cancels the current input or output layout. Cancel is equivalent to the user’s pressing the cancel key combination (usually Command-.) or pressing the Cancel button. In the input layout, CANCEL cancels the record or dialog and exits the layout. In an output layout that is being displayed with a MODIFY ELECTION or DISPLAY ELECTION command, CANCEL cancels the command.

After the layout is cancelled, the OK system variable is set to 0.

If there is a close box on a window and the user clicks on the close box, CANCEL should be called in the procedure when the close box is clicked.

CANCEL is commonly executed as a result of a menu item being chosen. CANCEL is also commonly used in the script of a No Action button. When used during data entry, the script can still save the record with the SAVE ECORD command. After the record is saved, using CANCEL avoids executing the  fter phase.

CANCEL cannot be queued up. In other words, executing two CANCEL commands in a row from within a single procedure would have the same effect as executing one.

The following example is a one-line procedure called from a procedure associated with a layout menu item. It cancels the current data entry:

    CANCEL

See also:  CCEPT, DISPLAY ELECTION, 
               MODIFY ELECTION, SAVE ECORD